efform_onload = function ()
{

};  

button_query_onclick = function (){
	efgrid.submitInqu( "ef_grid_result", "ZM","ZMCN60","query");
}

button_insert_onclick = function (){
	if (isSelected("ef_grid_result") == 0)return; 
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCN60","insert",true);
} 
button_update_onclick = function (){
	var grid=isSelected("ef_grid_result");
	if (grid == 0)return; 
	var rows=grid.getCheckedRows();
	for(var i=0;i<rows.length;i++)
	{
		if(grid.getCellValueByColumnName(rows[i],"fdStatus")!="草拟")
		{
			EFAlert("只能对草拟的记录进行修改！"); return;
		}
	}
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCN60","update",true);
} 
button_report_onclick = function (){
	var grid=isSelected("ef_grid_result");
	if (grid == 0)return; 
	var rows=grid.getCheckedRows();
	for(var i=0;i<rows.length;i++)
	{
		if(grid.getCellValueByColumnName(rows[i],"fdStatus")!="草拟")
		{
			EFAlert("该记录或有记录已经上报！"); return;
		}
	}
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCN60","report",true);
} 

button_delete_onclick = function (){
	var grid=isSelected("ef_grid_result");
	if (grid == 0)return; 
	var rows=grid.getCheckedRows();
	for(var i=0;i<rows.length;i++)
	{
		if(grid.getCellValueByColumnName(rows[i],"fdStatus")!="草拟")
		{
			EFAlert("只能对草拟的记录进行删除！"); return;
		}
	}
	EFConfirm('你确认要删除吗?', '确认框', function(r) {
		if(r)efgrid.submitForm( "ef_grid_result", "ZM","ZMCN60","delete",true);
	});
}
efgrid_afterAddNewRow = function(grid_id){ 
	var grid = efgrid.getGridObject(grid_id);
	var rows = grid.getCheckedRows();  
	if(grid_id=="ef_grid_result")
	{

	   
		for(var i = 0 ; i < rows.length;i++){
			grid.setCellValue(rows[i],0,"草拟",TYPE_DATA);
//			grid.setCellValue(rows[i],3,fdBjdw,TYPE_DATA);
		}
	}
}